<!---
Copyright: (c) 2006 The MachBlog Authors
Authors: Matt Woodward (mpwoodward@gmail.com) & Peter J. Farrell (pjf@maestropublishing.com)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. 
You may obtain a copy of the License at 

http://www.apache.org/licenses/LICENSE-2.0 

Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
See the License for the specific language governing permissions and 
limitations under the License.

$Id: AggregatorDAO.cfc 1190 2007-07-14 17:22:31Z pfarrell $

Notes:
TODO: have read method return an aggregator bean instead of a query
--->
<cfcomponent
	displayname="AggregatorDAO"
	output="false"
	hint="Base AggregatorDAO for MachBlog">

	<!---
	PROPERTIES
	--->
	<cfproperty name="datasource" type="org.machblog.datasource.Datasource" required="true" />
	<cfproperty name="resourceBundleFacade" type="org.machblog.facades.ResourceBundleFacade" required="true" />

	<!---
	INITIALIZATION / CONFIGURATION
	--->
	<cffunction name="init" access="public" output="false" returntype="AggregatorDAO" 
		hint="Constructor for this CFC.">
		<cfreturn this />
	</cffunction>

	<cffunction name="setDatasource" access="public" output="false" returntype="void"
		hint="Dependency: injected">
		<cfargument name="datasource" type="org.machblog.datasource.Datasource" required="true" />
		<cfset variables.datasource = arguments.datasource />
	</cffunction>	
	<cffunction name="getDatasource" access="private" output="false" returntype="org.machblog.datasource.Datasource">
		<cfreturn variables.datasource />
	</cffunction>
	
	<cffunction name="setResourceBundleFacade" access="public" output="false" returntype="void" 
		hint="Dependency: injected">
		<cfargument name="resourceBundleFacade" type="org.machblog.facades.ResourceBundleFacade" required="true" />
		<cfset variables.resourceBundleFacade = arguments.resourceBundleFacade />
	</cffunction>
	<cffunction name="getResourceBundleFacade" access="private" output="false" returntype="org.machblog.facades.ResourceBundleFacade">
		<cfreturn variables.resourceBundleFacade />
	</cffunction>

	<!---
	PUBLIC FUNCTIONS
	--->
	<cffunction name="create" access="public" output="false" returntype="void" hint="Creates a new aggregator">
		<cfargument name="aggregator" type="Aggregator" required="true" />
	</cffunction>

	<cffunction name="read" access="public" output="false" returntype="query" hint="Populates a Aggregator bean">
		<cfargument name="aggregatorId" type="string" required="true" />
	</cffunction>
	
	<cffunction name="update" access="public" output="false" returntype="void" hint="Updates an aggregator.">
		<cfargument name="aggregator" type="Aggregator" required="true" />
	</cffunction>
	
	<cffunction name="delete" access="public" output="false" returntype="void" hint="Deletes an aggregator.">
		<cfargument name="aggregator" type="Aggregator" required="true" />
	</cffunction>
	
	<cffunction name="updateLastPing" access="public" output="false" returntype="void" 
		hint="Updates an aggregator's last ping date">
		<cfargument name="aggregatorId" type="uuid" required="true" />
	</cffunction>
	
</cfcomponent>